<extend name="./Common/View/Public/list.html" />

<block name="page_title">结果列表</block>
<block name="search">
    <div class="layui-input-inline">
        <select name="project_id" id="project_id" lay-filter="project_id" api="rate/project/slist" affect="#user_id" empty="项目"></select>
    </div>
    <div class="layui-input-inline">
        <select name="user_id" id="user_id" lay-filter="user_id" api="rate/user/slist/type/1" depend="#project_id" empty="被评用户"></select>
    </div>
    <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="min" placeholder="最小分数" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid">-</div>
    <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="max" placeholder="最大分数" autocomplete="off" class="layui-input">
    </div>
</block>

<block name="toolbar">
    {:W('Todo/UI/toolbar',array('结果',array('exports')))}
</block>

<block name="main">
    <script type="text/javascript">
        var list = {api:"{$Think.const.MODULE_NAME}/{$Think.const.CONTROLLER_NAME}/"};
        list.columns =  [[
            {checkbox: true, fixed: true}
            , {field:'project_id', minWidth:100, title : '项目名称', sort: true, templet: '#tpl_project'}
            , {field:'name', minWidth:150, title : '用户姓名'}
            , {field:'score', minWidth:100, title : '分数'}
            , {field:'people', minWidth:100, title : '打分人数'}
            , {field:'sort', minWidth:100, title : '排名'}
            ,{fixed: 'right', minWidth:160, align:'center', toolbar: '#tpl_bar'}
        ]];
    </script>
    <script type="text/html" id="tpl_project">
        {{ format_data_project(d.project_id) }}
    </script>
    <script type="text/html" id="tpl_bar">
        <a class="layui-btn layui-btn-xs" lay-event="view">详细</a>
    </script>
</block>
<block name="script">
    <script src="/api/Rate/Project/format"></script>
</block>